package com.dd.dus.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.dd.dc.entity.users.DUserRoleRelation;
import com.dd.dus.mapper.DUserRoleRelationMapper;
import com.dd.dus.service.IDUserRoleRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户角色关系信息表 服务实现类
 * </p>
 *
 * @author JueDream
 * @since 2021-03-12
 */
@Service
public class DUserRoleRelationServiceImpl extends ServiceImpl<DUserRoleRelationMapper, DUserRoleRelation> implements IDUserRoleRelationService {

    @Autowired
    DUserRoleRelationMapper dUserRoleRelationMapper;

    @Override
    public List<DUserRoleRelation> queryRelationByRoleId(Integer roleId) {
        LambdaQueryWrapper<DUserRoleRelation> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(DUserRoleRelation::getRoleId, roleId);
        return dUserRoleRelationMapper.selectList(queryWrapper);
    }
}
